<div class="row breadcrumb">
    <div class="col-md-12 ">
        <ul class="breadcrumb">
            <li>
                <h3>
                    <a href="index.html">书签</a>
                </h3>
            </li>
            <li>
                <a href="#">原始数据</a>
            </li>
        </ul>

        <div>
            <div id="alert1"  class="alert fade in">
                <button id="hideAlertBtn" type="button" class="close" aria-hidden="true">×</button>
            </div>
            <button id="updateBookMarksBtn" type="button" class="btn btn-default" data-loading-text="正在加载..." >更新数据</button>
            <small>点击统计会保留</small>
        </div>
    </div>
</div>

<div class="row breadcrumb">
    <div class="col-md-12 ">
        <% for(var i = 0; i < bookMarks.length; i++) { %>
        <h4>
            <a href="<%= bookMarks[i].url %>
                ">
                <%= bookMarks[i].title %></a>
        </h4>
        <% } %></div>
</div>

<script type="text/javascript">
    $(document).ready(function () {  
        $('#alert1').hide();  
    });  

    $('#updateBookMarksBtn').on('click', function(event) {
        var data = {};
        $.ajax({
            type: "POST",
            url: '/admin/bm/update',
            data: data,
            success: function(data, textStatus) {
                if (data.success) {
                    $('#alert1').append('成功保存!');
                    $('#alert1').addClass('alert-success');
                } else {
                    $('#alert1').append(data.err);
                    $('#alert1').addClass('alert-danger');
                }
            }
        });


        //alert('ij');
        $('#alert1').show();
    });
    $('#hideAlertBtn').on('click', function(event) {
        $('#alert1').hide();
    });
</script>